
class Event:
    def __init__(self) -> None:
        self.id = ''
        self.group_id = ''
        self.time = ''
        self.topics = list()
    def __init__(self, id, group_id, time, topics) -> None:
        self.id = id
        self.group_id = group_id
        self.time = time
        self.topics = topics
    def to_dict(self) -> dict:
        return {
            'id': self.id,
            'group_id': self.group_id,
            'time': self.time,
            'topics': self.topics
        }

class Member:
    def __init__(self) -> None:
        self.id = ''
        self.topics = ''
    def __init__(self, id, topics:list) -> None:
        self.id = id
        self.topics = topics
    def to_dict(self):
        return {
            'id': self.id,
            'topics': self.topics
        }

class Response:
    def __init__(self, event_id, member_id, response) -> None:
        self.event_id = event_id
        self.member_id = member_id
        self.response = response

class EventList:
    def __init__(self, l:list) -> None:
        self.index_dict = dict()
        self.event_list = l
        for i, e in enumerate(l):
            self.index_dict[e.id]=i
    def contains(self, event_id):
        return self.index_dict.__contains__(event_id)
    def get(self, event_id)->Event:
        return self.event_list[self.index_dict[event_id]]

class MemberList:
    def __init__(self, l:list) -> None:
        self.index_dict = dict()
        self.member_list = l
        for i, m in enumerate(l):
            self.index_dict[m.id]=i
    def contains(self, member_id):
        return self.index_dict.__contains__(member_id)
    def get(self, member_id)->Member:
        return self.member_list[self.index_dict[member_id]]
        
class ResponseList:
    def __init__(self) -> None:
        self.response_list = list()

